﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.ComponentModel.Composition;

namespace Steve.UI.Extensions
{
    [Export(typeof(IHttpContextBaseBuilder))]
    [PartCreationPolicy(CreationPolicy.Shared)]
    public sealed class HttpContextBaseBuilder : IHttpContextBaseBuilder
    {
        public HttpContextBase BuildCurrent()
        {
            var current = HttpContext.Current;

            if (current == null) return null;

            return new HttpContextWrapper(current);
        }
    }
}
